<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>样品管理</title>
    <jsp:include page="/WEB-INF/views/common/link.jsp"/>

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <%@include file="/WEB-INF/views/common/navbar.jsp" %>
    <!--菜单回显-->
    <c:set var="currentMenu" value="sample"/>
    <%@include file="/WEB-INF/views/common/menu.jsp" %>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>样品管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
               <form class="form-inline" id="searchForm" action="/sample/list" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <div class="form-group">
                        <label for="sampleNum">样品编号:</label>
                        <input type="text" class="form-control" id="sampleNum" name="sampleNum" value="${qo.sampleNum}"
                               placeholder="请输入样品标号">
                    </div>
                   <div class="form-group">
                       <label for="voyageNum">航次:</label>
                       <input type="text" class="form-control" id="voyageNum" name="voyageNum" value="${qo.voyageNum}"
                              placeholder="请输入航次">
                   </div>
                    <div class="form-group">
                        <label for="positionX">X坐标:</label>
                        <input type="number" class="form-control" id="positionX" name="position_X_Min" value="${qo.position_X_Min}"
                                placeholder="请输入最小值"> ~
                        <input type="number" class="form-control" id="positionX" name="position_X_Max" value="${qo.position_X_Max}"
                               placeholder="请输入最大值">

                    </div>
                   <div class="form-group">
                       <label for="positionY">Y坐标:</label>
                       <input type="number" class="form-control" id="positionY" name="position_Y_Min" value="${qo.position_Y_Min}"
                              placeholder="请输入最小值"> ~
                       <input type="number" class="form-control" id="positionY" name="position_Y_Max" value="${qo.position_Y_Max}"
                              placeholder="请输入最大值">

                   </div>
                    <button id="btn_query" class="btn btn-default">查询</button>

<%--                <a href="/work/input" class="btn btn-success btn-input" style="margin: 10px">--%>
<%--                    <span class="glyphicon glyphicon-plus"></span> 添加--%>
<%--                </a>--%>
<%--                <a href="/work/export" class="btn btn-warning">--%>
<%--                    <span class="glyphicon glyphicon-download"></span> 导出--%>
<%--                </a>--%>
                <a href="#" class="btn btn-warning btn-import">
                    <span class="glyphicon glyphicon-upload"></span> 导入
                </a>
                    <script>
                        $(".btn-import").click(function () {
                            $("#importModal").modal('show');

                        })
                    </script>


               </form>

                <!--编写内容-->
                <div class="box-body table-responsive no-padding ">
                    <table class="table table-hover table-bordered" align="center">
                        <tr>
                            <th>序号</th>
                            <th>样品编号</th>
                            <th>调查船</th>
                            <th>航次</th>
                            <th>海域</th>
                            <th>站位</th>
                            <th>X坐标</th>
                            <th>Y坐标</th>
                            <th>详细地址</th>
                            <th>结束深度</th>
                            <th>心长</th>
                            <th>存放位置</th>
                            <th>保存状况</th>
                            <th>备注</th>
                        </tr>
<%--                        items 遍历数据的目标   EL    var d
                             for(Work dept : list){
                                  dept
                             }--%>
                        <c:forEach items="${pageInfo.list}" var="d" varStatus="vs">
                            <tr>
                                <td>${d.id}</td>
                                <td>${d.sampleNum}</td>
                                <td>${d.surveryName}</td>
                                <td>${d.voyageNum}</td>
                                <td>${d.detailPosition.seaAreaName}</td>
                                <td>${d.detailPosition.detailStation}</td>
                                <td>${d.detailPosition.positionX}</td>
                                <td>${d.detailPosition.positionY}</td>
                                <td>${d.detailPosition.detailAddress}</td>
                                <td>${d.heightEnd}</td>
                                <td>${d.cardiomegaly}</td>
                                <td>${d.savePosition}</td>
                                <td>${d.saveSolution}</td>
                                <td>${d.comment}</td>
<%--                                <td>--%>
<%--                                    <a class="btn btn-info btn-xs btn-input" href="/work/input?id=${d.id}">--%>
<%--                                        <span class="glyphicon glyphicon-pencil"></span> 修改--%>
<%--                                    </a>--%>
<%--                                    <a href="javaScript:void(0);" data-url="/work/delete?id=${d.id}" class="btn btn-danger btn-xs btn-delete">--%>
<%--                                        <span class="glyphicon glyphicon-trash"></span> 删除--%>
<%--                                    </a>--%>
<%--                                </td>--%>
                            </tr>
                        </c:forEach>
                    </table>
                    <!--分页-->
                    <%@include file="/WEB-INF/views/common/page.jsp" %>
                </div>
            </div>
        </section>
    </div>
    <%@include file="/WEB-INF/views/common/footer.jsp" %>
</div>




<script>

    $(function(){
        var da = $(".my_red");
        da.each(function (index) {
            console.log($(this).text());
            if($(this).text()<=30){
                $(this).css("color","red")
            }
        })
    });
</script>
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">导入</h4>
            </div>
            <form class="form-horizontal" action="/sample/importXls" enctype="multipart/form-data" method="post" id="importForm">
                <div class="modal-body">
                    <div class="form-group" style="margin-top: 10px;">
                        <label  class="col-sm-3 control-label"></label>
                        <div class="col-sm-6">
                            <!-- 文件上传框 -->
                            <input type="file" name="multipartFile"/>
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <div class="col-sm-3"></div>
<%--                        <div class="col-sm-6">--%>
<%--                            <a href="/upload/work_upload.xls" class="btn btn-success" >--%>
<%--                                <span class="glyphicon glyphicon-download"></span> 下载模板--%>
<%--                            </a>--%>
<%--                        </div>--%>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary btn-submit">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
